package com.hqd.jjvm.jnative.io;

import com.hqd.jjvm.jnative.JNativeRegistry;
import com.hqd.jjvm.rtda.JThread;

public class JFileDescriptorNativeRegistry extends JNativeRegistry {
    private static final JFileDescriptorNativeRegistry instance = new JFileDescriptorNativeRegistry();
    protected static final String CLASS_PATH = "java/io/FileDescriptor";

    static {
        registry(CLASS_PATH, "initIDs", "()V", JFileDescriptorNativeRegistry::registerNatives);
        registry(CLASS_PATH, "set", "(I)J", JFileDescriptorNativeRegistry::set);
    }

    protected static void set(JThread jThread) {
        jThread.getJvmStack().pushOperandStackLongVal(0L);
    }

    public static JFileDescriptorNativeRegistry getInstance() {
        return instance;
    }
}
